package com.bingxue.edu.management.shop.model.query;

import com.bingxue.edu.common.enums.OrderStatusEnum;
import com.bingxue.edu.common.enums.PayTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

/**
 * 购课订单查询条件
 *
 * @author panbo
 * @since 2024/08/27 14:31
 */
@Data
@Schema(description = "购课订单查询条件")
public class OrderQuery {

    @Schema(description = "订单编号")
    private String orderId;

    @Schema(description = "支付方式")
    private PayTypeEnum payType;

    @Schema(description = "财务账户")
    private String finAccountId;

    @Schema(description = "学生id")
    private String studentId;

    @Schema(description = "订单状态")
    private List<OrderStatusEnum> status;

    private LocalDate createDateFrom;
    private LocalDate createDateTo;

    private LocalDate payDateFrom;
    private LocalDate payDateTo;

    public LocalDate getCreateDateTo() {
        return createDateTo == null ? null : createDateTo.plusDays(1);
    }

    public LocalDate getPayDateTo() {
        return payDateTo == null ? null : payDateTo.plusDays(1);
    }
}
